package org.ssh.service.impl;

import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.ssh.dao.BackLogDao;
import org.ssh.pojo.BacklogEntity;
import org.ssh.service.BackLogService;

import java.util.List;

/**
 * @author ZH
 * @date 2022年01月18日 12:26:00
 * @version: 1.0.0
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class BackLogServiceImpl implements BackLogService {

    @Autowired
    private BackLogDao backLogDao;

    @Override
    public BacklogEntity getBack(long id) {
        return  backLogDao.getBackLog(id);
    }

    @Override
    public List getAll() {
        Session session = backLogDao.getSession();
        String hql = "from BacklogEntity ";
        return session.createQuery(hql).list();
    }


}
